<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_CreateTable_Option extends CI_Migration
{
    public function up()
    {
        $this->dbforge->add_field('id');
        $this->dbforge->add_field(array(
            'key'   => array('type' => 'VARCHAR', 'constraint' => '100'),
            'value' => array('type' => 'VARCHAR', 'constraint' => '100',),
        ));
        $this->dbforge->create_table('option');
        $this->db->simple_query('ALTER TABLE option ADD UNIQUE (key)');
    }

    public function down()
    {
        $this->dbforge->drop_table('option');
    }
} 